/**
 * Created with IntelliJ IDEA.
 * Description:1、通过继承Thread实现多限额很难过
 * User: 东莞呵呵
 * Date:2022-08-30
 * Time:8:55
 */

class MyThread extends Thread{
    @Override
    public void run() {
        while (true){
            System.out.println("run1");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}

public class Demo1 {
    public static void main(String[] args) {
        MyThread thread=new MyThread();
        thread.start();

        while(true){
            System.out.println("run2");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
